package BIOtest;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;

/**
 客户端
 */
public class Client {
    public static void main(String[] args) throws IOException {
        System.out.println("=======客户端");
        //创建一个访问服务端的socket
        Socket socket = new Socket("127.0.0.1",9000);
        //从socket获取一个字节输出流
        OutputStream out = socket.getOutputStream();
        //把输出流包装成打印流
        PrintWriter printWriter = new PrintWriter(out);
        //写数据到服务器端
        printWriter.println("第一次测试BIO");
        printWriter.flush();

    }
}
